package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.context.BaseContext;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.BeanUtils;

import java.util.List;

@Mapper
public interface CategoryMapper {
    public void addCategory(Category category);
    @Select("select * from category")
    List<Category>getByalltypes();

    public Page<Category> getBypage(CategoryPageQueryDTO dto);
    @Update("update category set status = #{status} where id = #{id}")
    public void start_or_stop(Category category);

    public void update_(Category cgy);
    @Select("select * from category  where type = #{type}")
    public List<Category> getBytype_(Integer type);
    @Select("select name from category where id = #{categoryid}")
    String getCategoryName_by_Categoryid(Long categoryid);
    @Delete("delete from category where id = #{id}")
    void delete_category(Long id);
    @Select("select name from category where id = #{id}")
    String getnamebycategoryid(Long id);
}
